/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import GUI.MainForm;
import java.awt.Dimension;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
import utils.BusyIndicator;

/**
 *
 * @author tuanhnm
 */
public class MainFormApp extends SingleFrameApplication {

    BusyIndicator busyIndicator = null;
    public static final int WIDTH_SIZE = 1000;
    public static final int HEIGHT_SIZE = 800;

    @Override
    protected void startup() {
        // Revoike MainForm JPanel
        getMainFrame().setResizable(false);
        getMainFrame().setPreferredSize(new Dimension(WIDTH_SIZE, HEIGHT_SIZE));
        busyIndicator = new BusyIndicator();
        getMainFrame().setGlassPane(busyIndicator);
//        getMainFrame().setLocationRelativeTo(null);
        show(new MainForm(this, busyIndicator));
    }

    public static void RefreshFrom(SingleFrameApplication paramFrame) {
        SingleFrameApplication cachedFrame = paramFrame;
        cachedFrame.getMainFrame().pack();
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of CRUB_DemoApp
     */
    public static MainFormApp getApplication() {
        return Application.getInstance(MainFormApp.class);
    }

    public static void main(String[] args) {
        Application.launch(MainFormApp.class, args);
    }
}
